<template>
	<view class="task-container">
		<navBar title="每日任务单" @goBack="uni.navigateBack()"></navBar>
		
		<view class="space-box"></view>
		<!-- @touchmove.stop.prevent="() => { }" -->
			<view class="fill-report">
				<view class="form">
					<view @click="changeProject" class="form-item">
						<view class="label required">项目名称</view>
						<view class="form-content">
							<view class="form-text" v-if="fillForm.projectInfo.name">{{fillForm.projectInfo.name || ''}}</view>
							<view class="form-text" v-else style="opacity: 0.5;">请选择项目</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>
					<view class="form-item">
						<view class="label required">施工开始时间</view>
						<view @click="clickTime('start')" class="form-content">
							<view class="form-text" style="max-width: 336upx;" v-if="fillForm.startTime">{{fillForm.startTime || ''}}</view>
							<view class="form-text" style="max-width: 336upx;opacity: 0.5;" v-else>请选择开始时间</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>
					<!-- :minDate="(new Date()).getTime()" -->
					<u-datetime-picker @confirm="confirmBuildStartDate" @cancel="buildStartDatePicker = false"
						v-model="timeVal" :show="buildStartDatePicker" :formatter="dateFormatter"
						 mode="datetime" />
					<view class="form-item">
						<view class="label required">施工结束时间</view>
						<view @click="clickTime('end')" class="form-content">
							<view class="form-text" style="max-width: 336upx;" v-if="fillForm.endTime">{{fillForm.endTime || ''}}</view>
							<view class="form-text" style="max-width: 336upx;opacity: 0.5;" v-else>请选择结束时间</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>
					<view @click="goToMultiplePage('jd')" class="form-item">
						<view class="label">接单人</view>
						<view class="form-content">
							<view class="form-text" v-if="fillForm.mjsDmJoinUserList.length">{{fillForm.mjsDmJoinUserList.map(it => it.name).join("、") || ''}}</view>
							<view class="form-text" v-if="!fillForm.mjsDmJoinUserList.length && !stateArr.includes(fillForm.taskState)" style="opacity: 0.5;">请选择人员</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>

					<view @click="goToMultiplePage('xs')" class="form-item">
						<view class="label required">施工巡视人</view>
						<view class="form-content">
							<view class="form-text" v-if="fillForm.xsrUserList.length">{{fillForm.xsrUserList.map(it => it.name).join("、") || ''}}</view>
							<view class="form-text" v-else style="opacity: 0.5;">请选择人员</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>

					<view @click="goToStakeMask" class="form-item">
						<view class="label required">今日施工桩号</view>
						<view class="form-content">
							<view class="form-text" v-if="fillForm.mjsDmJoinPbList.length">{{fillForm.mjsDmJoinPbList.map(it => it.code).join("、") || ''}}</view>
							<view class="form-text" v-else style="opacity: 0.5;">请选择桩号</view>
							<u-icon name="arrow-right" color="#a7aebd" size="16" v-if="type =='add' || type =='edit'"></u-icon>
						</view>
					</view>

					<view class="form-item">
						<view class="label required" style="width: 260rpx;">施工部位</view>
						<!-- <view class="form-content" v-if="fillForm.constructionSite">{{ fillForm.constructionSite }}  MJS坑底加固补桩</view> -->
						<view class="form-content">
							  <u--input  border="none" v-model="fillForm.constructionSite" :disabled="type !=='add' && type !=='edit'" disabledColor="#fff"></u--input>
						</view>
					</view>

					<view  class="form-item" style="border-bottom: none;">
						<view class="label required">主要施工内容</view>
					</view>
					<view  style="border-bottom: none;padding: 0 30rpx;">
						<u--textarea :disabled="type !=='add' && type !=='edit'" v-model="fillForm.constructionContent" placeholder="请输入内容" :confirmType="null" height="200" :maxlength="-1" :adjustPosition="false" :autoHeight="false"></u--textarea>
					</view>
					<view class="form-item" style="border-bottom: none;">
						<view>施工图纸</view>
					</view>
					<view style="padding:0 40rpx;">
						<u-upload v-if="type =='add' || type =='edit'" :fileList="checkListImg" @afterRead="uploadImage" @delete="deleteImage" name="Img" multiple
							:maxCount="9" :previewFullImage="true" accept="image" width="200rpx" height="200rpx"></u-upload>
					</view>
					<commonLookImage v-if="stateArr.includes(fillForm.taskState)" :imageArr="checkListImg" width="80px" height="80px"></commonLookImage>
					<u-empty  v-if="stateArr.includes(fillForm.taskState) && !checkListImg.length"  mode="data" text="暂无施工图片" width="40" height="40" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
					<view  class="form-item" style="border-bottom: none;margin-top: 60rpx;">
						<view class="label required">发起人签名</view>
					</view>
					<signature v-if="type =='add' || type =='edit'" :imagePath="initiatorUrl" :footerShow="true" canvasId="canvas1" @savePath="getName1" @clearPath="clearName(1)" ref="refSignOne"></signature>
					<commonLookImage v-if="stateArr.includes(fillForm.taskState)" :imageArr="initiatorNameAttach"></commonLookImage>
					<view  class="form-item" style="border-bottom: none;">
						<view class="label">现场施工人员签名</view>
					</view>
					<signature v-if="type =='add' || type =='edit'" :imagePath="siteBuilderUrl" :footerShow="true" canvasId="canvas2" @clearPath="clearName(2)" ref="refSignTwo"></signature>
					<commonLookImage v-if="stateArr.includes(fillForm.taskState)" :imageArr="siteBuilderNameAttach"></commonLookImage>
					<u-empty  v-if="stateArr.includes(fillForm.taskState) && !siteBuilderNameAttach.length"  mode="data" text="暂无现场施工人员签名" width="40" height="40" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
					<u-datetime-picker @confirm="confirmBuildEndDate" @cancel="buildEndDatePicker = false"
						v-model="timeVal" :show="buildEndDatePicker" :formatter="dateFormatter"
						 mode="datetime" />
				</view>
				<view class="footer-button">
					<view class="button-placeholder"></view>
					<view class="button-group" v-if="type =='add' || type =='edit'">
						<!-- <button @click="showModal = true" :loading="isLoading" class="button-error" v-if="type !== 'add'">删除</button> -->
						<button @click="clickSubmit('save')" :loading="isLoading" class="button-primary" style="margin: 0 20rpx;">保存</button>
						<button @click="clickSubmit('action')" :loading="isLoading" class="button-warn">发起</button>
					</view>
					<view class="button-group" v-if="fillForm.taskState == 'pending_order' && isShowBackButton">
						<button @click="$u.throttle(clickTurnDown, 1000)" :loading="isLoading" class="button-error">驳回</button>
						<button @click="clickSubmit('jiedan')" :loading="isLoading" class="button-primary">接单</button>
					</view>
					
				</view>
				<u-modal :show="showModal" title="提示" content="确认删除此任务单、同时删除该任务单下的施工巡视记录单?" confirmColor="#FF6A6A" confirmText="删除" :showCancelButton="true" @confirm="$u.throttle(confirmDel, 1000)" @cancel="showModal = false"></u-modal>
			</view>
	</view>
</template>

<script>
	import {mapGetters} from "vuex";
	import {getSystemHeightInfo,isPositiveInteger,imgFun,getFormCheckResult} from "@/utils/common.js";
	import {handleFormatDate,compareDate} from "@/utils/date.js";
	import fileMixin from "@/mixins/file.js";
	import mixins from "@/utils/mixins.js"
	import signature from "@/subpackage-mjs/pages/comoponents/signature.vue";
	import { uploadFile } from '@/utils/request'
	import { getPicture, deleteImg, doc_deleteAttachs } from '@/api/doc.js'
	import { mjsProject_list, mjsDailyMission_save, mjsDailyMission_get, mjsDailyMission_action, mjsDailyMission_delete,mjsDailyMission_turnDown, mjsDailyMission_getConstructionPartsAndContent } from "@/api/mjs.js"
	export default {
		name: "add-task",
		mixins: [fileMixin, mixins],
		props: {},
		components:{
			signature
		},
		data() {
			return {
				// 容器之外的高度
				containerOutsideHeight: 0,
				timeVal: Number(new Date()),
				// 填报表单
				fillForm: {
					projectInfo:{},
					startTime:'',
					endTime:'',
					mjsDmJoinUserList:[], 	//接单人
					mjsDmJoinPbList:[], //今日施工桩号
					constructionSite:'', //施工部位
					constructionContent:'', //主要施工内容
					constructionDrawing:'', //施工图
					initiatorName:undefined,	//发起人签名
					siteBuilderName:undefined, //现场施工人员签名
					xsrUserList:[],     //巡视人
				},
				// 施工结束时间日期弹框显示状态
				buildStartDatePicker: false,
				buildEndDatePicker: false,
				// 是否在加载中
				isLoading: false,
				checkListImg:[],
				initiatorNameAttach:[],
				siteBuilderNameAttach:[],
				showModal:false,
				type:'add',
				initiatorUrl:'',
				siteBuilderUrl:'',
				stateArr:['finished', 'pending_order', 'ordered'],
				isShowBackButton:false
				
			}
		},
		computed: {
			...mapGetters(['dictMap'])
		},
		watch: {},
		async onLoad(op) {
			if(op && op.id) {
				this.type = op.type
				await this.getDetailById(op.id)
			}
			console.log(this.type, '类型')
		},
		async mounted() {
			this.initContainerData();
			if(this.type === 'add') {
				let listResult = await this.getProjectList();
				if(listResult &&  listResult.length === 1) {
					this.fillForm.projectInfo = listResult[0];
				}
			}
			// let result = await this.getItemImage(70365);
			// console.log(result, '结果')
		},
		methods: {
			clickTime(state) {
				if(this.fillForm.taskState === 'pending_order') return
				if(state === 'start') {
					this.buildStartDatePicker = true
				}else{
					this.buildEndDatePicker = true
				}
			},
			// 获取详情信息 
			getDetailById(id) {
				return new Promise(resolve => {
					mjsDailyMission_get({id}).then(res => {
						console.log(res, '详情数据', this.$store.getters.userName)
						let obj = res.result
						this.fillForm.id = obj.id
						this.fillForm.taskState = obj.taskState
						this.fillForm.projectInfo = {
							id:obj.mpId,
							name:obj.mjsProject.name || '',
						},
						this.fillForm.startTime = this.getDate2(obj.startTime)
						this.fillForm.endTime = this.getDate2(obj.endTime)
						this.fillForm.mjsDmJoinUserList = obj.mjsDmJoinUserList.filter(it => it.type === 'jd').map(item => ({
							userId:item.dmUserId,
							name:item.dmUserName
						}))
						this.fillForm.xsrUserList = obj.mjsDmJoinUserList.filter(it => it.type === 'xs').map(item => ({
							userId:item.dmUserId,
							name:item.dmUserName
						}))
						this.fillForm.mjsDmJoinPbList = obj.mjsDmJoinPbList.map(item => ({
							id:item.pdId,
							code:item.code
						}))
						this.fillForm.constructionContent = obj.constructionContent
						this.fillForm.constructionSite = obj.constructionSite
						this.fillForm.constructionDrawing = obj.constructionDrawing || ''
					
						this.fillForm.siteBuilderName = obj.siteBuilderName
						this.fillForm.initiatorName = obj.initiatorName
						if(obj.constructionDrawingAttach && obj.constructionDrawingAttach.length) {
							this.checkListImg = obj.constructionDrawingAttach.map(it => ({
								id:it.id,
								url:this.$config.IMG_FILE_URL + it.fileName
							}))
						}
						if(obj.initiatorNameAttach && obj.initiatorNameAttach.length) {
							this.initiatorNameAttach = obj.initiatorNameAttach.map(it => ({
								id:it.id,
								url:this.$config.IMG_FILE_URL + it.fileName
							}))
							this.initiatorUrl = this.initiatorNameAttach.map(u => u.url).join('')
						}
						if(obj.siteBuilderNameAttach && obj.siteBuilderNameAttach.length) {
							this.siteBuilderNameAttach = obj.siteBuilderNameAttach.map(it => ({
								id:it.id,
								url:this.$config.IMG_FILE_URL + it.fileName
							}))
							this.siteBuilderUrl = this.siteBuilderNameAttach.map(u => u.url).join('')
						}
						if(this.fillForm.mjsDmJoinUserList.length){
							let arr = this.fillForm.mjsDmJoinUserList.map(it => it.userId)
							if(arr.includes(this.$store.getters.userName.id)) {
								this.isShowBackButton = true
							}
							
						}
					})
					resolve()
				})

			},
			async getItemImage(docId) {
				return await new Promise((resolve, reject) => {
					getPicture({docId}).then(res => {
						resolve(res.result.map(it => ({
							url: this.$config.IMG_FILE_URL + it.fileName,
							id: it.id
						})) || []);
					}).catch(err => reject(err))
				})
			},
			async getName1(obj) {
				console.log(obj, 'obj--00')
				// this.tempPath = obj.tempFilePath
			},
			clearName(num) {
				console.log('清除')
				if(num == 1) {
					this.$refs.refSignOne.isDrawing = false
					this.initiatorUrl = ''
				}else if(num == 2) {
					this.$refs.refSignTwo.isDrawing = false
					this.siteBuilderUrl = ''
				}
			},
			/** 初始化容器数据 */
			initContainerData() {
				const { stateHeight, bottomHeight, navbarHeight } = getSystemHeightInfo();
				this.containerOutsideHeight = stateHeight + bottomHeight + navbarHeight + 70;
			},
			getTmepFilePath(path) {
				return new Promise(async resolve => {
					uni.compressImage({
						src:path,
						quality: 80,
						success: async res => {
							let data = await uploadFile({
								url: "rest/doc/uploadDoc",
								formData:{},
								filePath:res.tempFilePath
							})
							resolve(JSON.parse(data))
						},
						fail: err => {
							resolve({})
						}
					 })
				})
			
			},
			confirmDel() {
				if(this.isRequest) return
				this.isRequest = true
				mjsDailyMission_delete({id:this.fillForm.id}).then(res => {
					if(res.success) {
						this.$message(res.message)
						this.isRequest = false
						uni.navigateBack({
							delta:1,
							success() {
								uni.$emit('refreshData', {isUpdate:true, index:0})
							}
						})
					}
				})
				this.showModal = false
			},
			async deleteFileBeforeSaving() {
				// 删除文件...
				if (this.deleteFileList) {
					await Promise.all([...this.deleteFileList].map(item => this.removeFileById(item)))
					this.deleteFileList = null
				}
			},
			handlerUploadFile() {
				return new Promise(async (resolve, reject) => {
					if (this.checkListImg.length) {
						const array = this.checkListImg.filter(item => !item.id)
						this.fillForm.constructionDrawing = await this.uploadFileList(array, this.fillForm.constructionDrawing)
					}
					resolve()
				})
			},
			/** 保存 */
			handleSaveFilleport(state) {
				return new Promise(async resolve => {
					//运行执行检查表
					await this.handlerUploadFile()
					if(this.$refs.refSignOne && this.$refs.refSignOne.isDrawing) {
						let resp= await  this.$refs.refSignOne.finish()
						let temp =  await this.getTmepFilePath(resp)
						if(temp) {
							this.fillForm.initiatorName = temp.result.id
						}
					}

					if(this.$refs.refSignTwo &&  this.$refs.refSignTwo.isDrawing) {
						let resp2 = await  this.$refs.refSignTwo.finish()
						let temp2 =  await this.getTmepFilePath(resp2)
						if(temp2) {
							this.fillForm.siteBuilderName = temp2.result.id
						}
					}
					// console.debug(this.fillForm, '对象')
					const arr1 = this.fillForm.mjsDmJoinUserList.map(it => ({dmUserId:it.userId, type:'jd',dmUserName:it.name}))
					const arr2 = this.fillForm.xsrUserList.map(it => ({dmUserId:it.userId, type:'xs',dmUserName:it.name}))
					let taskState = undefined
					if(this.type === 'add') {
						taskState = 'primed_for_action'
					}
					if(this.type === 'edit' && state === 'save') {
						taskState =  'primed_for_action'
					}
					if(arr1.length === 0 && state === 'action') {
						taskState = 'ordered'
					}
					if(arr1.length > 0 && state === 'action') {
						taskState = 'pending_order'
					}
					if(state === 'jiedan') {
						taskState = 'ordered'
					}
					let resq = {
						id:this.fillForm.id ? this.fillForm.id : undefined,
						mpId:this.fillForm.projectInfo.id,
						startTime:this.fillForm.startTime,
						endTime:this.fillForm.endTime,
						mjsDmJoinUserList:[...arr1,...arr2],
						mjsDmJoinPbList:this.fillForm.mjsDmJoinPbList.map(it => ({pdId:it.id, code:it.code})),
						constructionSite:this.fillForm.constructionSite,
						constructionContent:this.fillForm.constructionContent,
						constructionDrawing:this.fillForm.constructionDrawing,
						initiatorName:this.fillForm.initiatorName,
						siteBuilderName:this.fillForm.siteBuilderName,
						taskState, //保存就是待发起  待发起传待接单  接单传已派单 驳回传待发起
					}

					console.error(resq, '入参')
					let api = state == 'save' ? mjsDailyMission_save : (state == 'action' ? mjsDailyMission_action : (state == 'jiedan' ? mjsDailyMission_action : ''))
					// return
					api(resq).then(res => {
						uni.showToast({
							title: res.message,
							icon: "none",
							duration: 1500,
						});
						this.initFillForm();
						setTimeout(() => {
							uni.navigateBack({
								delta:1,
								success() {
									uni.$emit('refreshData', {isUpdate:true, index:0})
								}
							})
						}, 1800)
						resolve();
					});
				});
			},
			clickTurnDown() {
				if(this.isLoading) return
				this.isLoading = true
				mjsDailyMission_turnDown({id:this.fillForm.id}).then(res => {
					if(res.success) {
						this.$message(res.message)
						this.isLoading = false
						uni.navigateBack({
							delta:1,
							success() {
								uni.$emit('refreshData', {isUpdate:true, index:0})
							}
						})
					}
				})
			},
			/** 点击提交按钮 */
			async clickSubmit(state) {
				// 表单校验...
				if(!this.fillForm.projectInfo.id) return this.$message('请选择项目!')
				if(!this.fillForm.startTime) return this.$message('请选择施工开始时间!')
				if(!this.fillForm.endTime) return this.$message('请选择施工结束时间!')
				if(!this.fillForm.xsrUserList.length) return this.$message('请选择施工巡视人!')
				if(!this.fillForm.mjsDmJoinPbList.length) return this.$message('请选择今日施工桩号!')
				if(!this.fillForm.constructionSite) return this.$message('请填写施工部位!')
				if(!this.fillForm.constructionContent) return this.$message('请输入主要施工内容!')
				if (!compareDate(this.fillForm.endTime, this.fillForm.startTime)) return this.$message('施工结束时间不可早于施工开始时间！')
				if(this.$refs.refSignOne && !this.$refs.refSignOne.isDrawing && !this.fillForm.initiatorName) return this.$message('发起人未签名!')
				
				// 调用接口...
				if (!this.isLoading) {
					this.isLoading = true;
					await this.deleteFileBeforeSaving()
					await this.handleSaveFilleport(state);
					this.isLoading = false;
				}
			},
			/** 初始化表单 */
			initFillForm() {
				this.$set(this.fillForm, 'projectInfo', {})
				this.$set(this.fillForm, 'startTime', '')
				this.$set(this.fillForm, 'endTime', '')
				this.$set(this.fillForm, 'mjsDmJoinUserList', [])
				this.$set(this.fillForm, 'mjsDmJoinPbList', [])
				this.$set(this.fillForm, 'constructionSite', '')
				this.$set(this.fillForm, 'constructionContent', '')
				this.$set(this.fillForm, 'constructionDrawing', '')
				this.$set(this.fillForm, 'initiatorName', '')
				this.$set(this.fillForm, 'siteBuilderName', '')
				this.$set(this.fillForm, 'xsrUserList', [])
				
			},
			confirmBuildStartDate(event) {
				this.fillForm.startTime = handleFormatDate(event.value, 3)
				this.buildStartDatePicker = false;
			},
			confirmBuildEndDate(event) {
				this.fillForm.endTime = handleFormatDate(event.value, 3)
				this.buildEndDatePicker = false;
			},

			/** 日期选择格式化 */
			dateFormatter(type, value) {
				if (type === 'year') {
					return `${value}年`
				} else if (type === 'month') {
					return `${value}月`
				} else if (type === 'day') {
					return `${value}日`
				} else if (type === 'hour') {
					return `${value}时`
				} else if (type === 'minute') {
					return `${value}分`
				}
				return value;
			},
			uploadImage(event) {
				for(var item in event.file){
					this[`checkList${event.name}`].push({
						...event.file[item],
						status: 'success',
						message: ''
					})
					
				}
			},
			deleteImage(event) {
				// console.log(event,'hhh')
				if (!this.deleteFileList) {
					this.deleteFileList = new Set()
				}
				if (event.file.id) {
					this.deleteFileList.add(event.file.id)
				}
				this[`checkList${event.name}`].splice(event.index, 1)
			},
			changeProject() {
				if(this.type !=='add' && this.type !=='edit') return
				uni.navigateTo({
					url:`/subpackage-mjs/pages/dailyTaskList/select-task-project`,
					events:{
						getRetrunData: (data) => {
							console.log(data)
							this.fillForm.projectInfo = {...data.data}
						}
					},
				})
			},
			/**
			 * jd 接单人
			 * xs 巡视人
			**/
			goToMultiplePage(type) {
				if(this.type !=='add' && this.type !=='edit') return
				uni.navigateTo({
					url:`/subpackage-mjs/pages/dailyTaskList/components/multiple-select`,
					events:{
						getMultipleData: (data) => {
							console.log(data, 'getMultipleData399')
							if(type === 'jd') {
								this.fillForm.mjsDmJoinUserList = data.data
							}else if(type === 'xs') {
								this.fillForm.xsrUserList = data.data
							}
						}
					},
					success: res => {
						let arr = []
						if(type === 'jd') {
							arr = this.fillForm.mjsDmJoinUserList.length ? this.fillForm.mjsDmJoinUserList.map(item => item.userId) : []
						}else if(type === 'xs') {
							arr = this.fillForm.xsrUserList.length ? this.fillForm.xsrUserList.map(item => item.userId) : []
						}
						res.eventChannel.emit('sendMultipleData', {
							data: arr
						})
					}
				})
			},
			goToStakeMask() {
				if(this.type !=='add' && this.type !=='edit') return
				if(!this.fillForm.projectInfo.id) return this.$message('请先选择项目!')
				uni.navigateTo({
					url:`/subpackage-mjs/pages/dailyTaskList/components/stake-mark-select`,
					events:{
						getMaskData: (data) => {
							console.log(data, 'getMaskData')
							this.fillForm.mjsDmJoinPbList = data.data
							// this.fillForm.constructionSite = data.data.length ? data.data[0].name : ''
							this.getRespContent(data.data.map(it => it.id))
						}
					},
					success: res => {
						res.eventChannel.emit('sendMaskData', {
							data: {
								arr:this.fillForm.mjsDmJoinPbList.length ? this.fillForm.mjsDmJoinPbList.map(item => item.id) : [],
								mpId:this.fillForm.projectInfo.id
							}
						})
					}
				})
			},
			getRespContent(arr) {
				mjsDailyMission_getConstructionPartsAndContent(arr).then(res => {
					console.log(res, '新接口')
					this.fillForm.constructionContent = res.result.constructionContent || ''
					this.fillForm.constructionSite = res.result.constructionSite || ''
				})
			},
			getProjectList() {
				return new Promise(async resolve => {
					let params = {
						currPage: 1,
						pageSize:20,
						projectId: uni.getStorageSync('isOwner'),
						params: {
							projectId: uni.getStorageSync('isOwner')
						},
					};
					let response  = await mjsProject_list(params);
					resolve(response.result.list || []);
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.task-container {
		/* #ifdef MP-WEIXIN */
		padding-top:200rpx
		/* #endif */
	}
	.fill-report {
		.form {
			background: #fff;
			padding-top: 26upx;

			.form-item {
				height: 100upx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin: 0 30upx;
				border-bottom: 1px solid #e2e5ed;

				&:last-of-type {
					border-bottom: none;
				}

				.label {
					color: #445469;
					line-height: 44upx;
					flex-shrink: 0;
				}

				.form-content {
					color: #22204e;
					display: flex;
					align-items: center;
				}

				.form-text {
					line-height: 58upx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					max-width: 302upx;
				}

				.form-text.none {
					opacity: .7;
					font-size: 30rpx;
				}

				.u-icon {
					margin-left: 40upx;
				}

				.uicon-close-circle-fill {
					margin-left: 32upx;
				}

				.u-input {
					width: 340upx;
					text-align: right;

					::v-deep .u-input__content__field-wrapper {
						margin-right: 24upx;
					}

					::v-deep .uni-input-wrapper {
						text-align: right;
					}
				}

				.u-switch {
					margin-right: 30upx;
				}
			}

			.no-inline {
				display: block;
				height: auto;

				.label {
					line-height: 100upx;
				}
			}
		}


	}

	.fill-report.mar-t {
		padding-top: 26upx;
	}

	.footer-button {
		height: 154upx;

		.button-placeholder {
			height: 100%;
		}

		.button-group {
			height: 154upx;
			padding: 30upx;
			box-sizing: border-box;
			background: #fff;
			position: fixed;
			width: 100vw;
			bottom: 0;
			z-index: 99;

			.button-primary {
				background: #2f80ed;
				border-radius: 4upx;
				color: #fff;
				font-weight: bold;
				line-height: 92upx;
				text-align: center;
			}
		}
	}

	.required {
		&::before {
			content: "*";
			color: #ff6a6a;
		}
	}
	.space-box {
		background-color: #f5f7fb;
		height: 40rpx;
	}
</style>